const express = require('express');
const app = express();
const router = require('./router');
const bodyParser = require('body-parser');

app.engine('html', require('express-art-template'));

app.use('/node_modules/', express.static('./node_modules/'));
app.use('/public/', express.static('./public/'));

// 配置body-parser一定要在挂在路由之前
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
// 路由模块
app.use(router);

app.listen(3000, () => {
    console.log('running');
});
